<?php

namespace app\api\model;

use think\Model;

class Virtual extends Model
{
    protected $name = 'virtual_money';

    public function updateMoney1($uid, $deal_ticket, $remark)
    {
        //更新用户羽毛数量
        Virtual::where(['user_id' => $uid])->setDec('virtual', $deal_ticket);
        Virtual::where(['user_id' => $uid])->update([
            'update_time' => date('Y-m-d H:i:s'),
            'remark' => $remark,
        ]);
    }
    public function updateMoney2($buyUser, $deal_ticket, $remark)
    {
        //更新用户羽毛数量
        Virtual::where(['user_id' => $buyUser])->setInc('virtual', $deal_ticket);
        Virtual::where(['user_id' => $buyUser])->update([
            'update_time' => date('Y-m-d H:i:s'),
            'remark' => $remark,
        ]);
    }
}